/*
 * @Author: your name
 * @Date: 2021-06-24 00:24:36
 * @LastEditTime: 2021-11-08 18:09:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /shujucaiji/lib/routes/project.js
 */
// 项目信息
const express = require('express');
const router = express.Router();

const outer = require('../handler/project');

// 查询项目信息列表
router.get('/list', async (req, res) => {
  const data = await outer.getProjectList();
  res.send(data);
});

// 创建项目信息
router.post('/create-project', async ( req, res) => {
  const data = await outer.createProjectInfo(req.body);
  res.send(data);
});

// 更新项目信息
router.post('/update-project', async (req, res) => {
  const data = await outer.updateProject(req.body);
  res.send(data);
});

// 删除项目信息
router.get('/delete-project', async(req, res) => {
  const { projectId } = req.query;
  const data = await outer.deleteProject(projectId);
  res.send(data);
});

// 获取直播地址
router.post('/live-address', async(req, res) => {
  const data = await outer.getLiveAddress(req.query);
  res.send(data);
});

// 更新项目信息
router.post('/update-project', async(req, res) => {
  res.send();
});

module.exports = router;